package net.uhuijia.enums;

/**
 * 直播状态枚举
 */
public enum LiveState {

    Living("1","直播中"),Lived("0","直播结束");

    private String state;
    private String name;

    LiveState(String state, String name) {
        this.state = state;
        this.name = name;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取直播状态
     * @param state
     * @return
     */
    public static LiveState getLiveState(String state){
        LiveState ls = null;
        switch (state){
            case "0":
                ls = LiveState.Living;
                break;
            case "1":
                ls= LiveState.Lived;
                break;
            default:
                break;
        }
        return ls;
    }
}
